package ru.enacu.common.dbupdater;

import org.springframework.jdbc.core.support.JdbcDaoSupport;

import java.sql.SQLException;

/**
 * @author enaku_adm
 * @since 08.09.2010 16:49:27
 */
public class DefaultVersionManager extends JdbcDaoSupport implements DatabaseVersionManager {
    public int getCurrentDbVersion() throws SQLException {
        return getJdbcTemplate().queryForInt("select ver from ver");
    }

    public void setDbVersion(int dbVersion) {
        getJdbcTemplate().update("update ver set ver = ?", new Object[]{dbVersion});
    }
}
